﻿ using System;
using System.Collections.Generic;
using System.Text;

namespace MethodArgumentContracts
{
    static class PreventingNull
    {
        [Arcana.Contract.Argument.Is.Not.Null("myArgument")]
        public static void SingleArgument(object myArgument)
        {
        }

        [Arcana.Contract.Argument.Is.Not.Null("myArgument", Exception = typeof(InvalidOperationException))]
        public static void SingleArgumentAndCustomException(object myArgument)
        {
        }

        [Arcana.Contract.Argument.All.Are.Not.Null("myCollectionArgument")]
        public static void CollectionArgument(IEnumerable<string> myCollectionArgument)
        {
        }

        [Arcana.Contract.Argument.All.Are.Not.Null("myCollectionArgument", Exception = typeof(InvalidOperationException))]
        public static void CollectionArgumentAndCustomException(IEnumerable<string> myCollectionArgument)
        {
        }
    }
}
